﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jemgine.Engine.Scripts
{
    [Category("System"), Node]
   public class Enable: Data.ScriptNode
    {
       public Enable()
       {
           AddInput("Fire", null);
           AddReference("Node", null);
           AddOutput("Relay", null);
       }

       public override void FireTerminal(int InputID, Data.ScriptPayload Payload)
       {
           var Target = ReferenceTerminals[0].GetTarget(Payload);
           if (Target is Data.ScriptNode) (Target as Data.ScriptNode).SetActive(true);
           OutputTerminals[0].Fire(Payload);
      }
    }

     [Category("System"), Node]
   public class Disable: Data.ScriptNode
    {
       public Disable()
       {
           AddInput("Fire", null);
           AddReference("Node", null);
           AddOutput("Relay", null);

       }

       public override void FireTerminal(int InputID, Data.ScriptPayload Payload)
       {
           var Target = ReferenceTerminals[0].GetTarget(Payload);
           if (Target is Data.ScriptNode) (Target as Data.ScriptNode).SetActive(false);
           OutputTerminals[0].Fire(Payload);
       }
    }
}
